package com.java.jim;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class JimSet {
	
	
	public void jimSet(){
		
		Set<String> sss = new HashSet<String>();
		
		sss.add("jimmy1");
		sss.add("jimmy2");
		sss.add("jimmy3");
		sss.add("jimmy1");
		sss.add("jimmy5");
		
		System.out.println(sss);
		
		
		Set<String> sss1 = new HashSet<String>();
		
		sss1.add("batra1");
		sss.addAll(sss1);
		
		
		// Hari, Can you please explain how to use Iterator in Set and Map...
		
//		Iterator<String> itr = new Iterator<String>(new JimSet());
//		System.out.println(sss.toArray());
//		Iterator<String> itr = sss.iterator();
//	while(itr.hasNext()){
//		System.out.println(itr.next());
//	}
	for (String string : sss) {
		System.out.println(sss);
	}
	
	
	}

}
